//
//@File    :	4.10_strtype4.cpp
//@Time    :	2021/08/03 17:35:39
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	line input
//

#include <string>
#include <iostream>
#include <cstring>
int main()
{
    using namespace std;
    char charr[20];
    string str;

    cout<<"Length of string in charr befor input:"
        <<strlen(charr)<<endl;
    cout<<"Length of string in str before input:"
        <<str.size()<<endl;
    cout<<"Enter a line of text:\n";
    cin.getline(charr,20);
    cout<<"Enter another line od text.\n";
    getline(cin,str);
    cout<<"You entered:"<<str<<endl;
    cout<<"Length of string in charr after input:"
        <<strlen(charr)<<endl;
    cout<<"Length of string in str after input:"
        <<str.size()<<endl;
    system("pause");
    return 0;
}